#@layout()
#define main()
<link href="#(base)/fslayui/plugins/formSelect/formSelects.css" rel="stylesheet"/>
<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">名称</label>
                <div class="layui-input-block">
                    <input type="text" name="name" required="" lay-verType="tips" lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input"/>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">选择班级</label>
                <div class="layui-input-block">
                    <select name="classids" xm-select="classids"  lay-verify="required" placeholder="请选择">
                        <option value="">请选择</option>
                        #for(acl : classList)
                            #if(acl.class_id == 0)
                        <optgroup label="#(acl.class_name)">
                                #for(bcl : classList)
                                    #if(acl.id == bcl.class_id)
                            <option value="#(bcl.id)" >#(bcl.class_name)</option>
                                    #end
                                #end
                        </optgroup>
                            #end
                        #end
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">选择科目</label>
                <div class="layui-input-block">
                    <select name="subjectids" xm-select="subjectids"  lay-verify="required" placeholder="请选择">
                        <option value="">请选择</option>
                        #for(subject : subjectList)
                            <option value="#(subject.id)" >#(subject.name)</option>
                        #end
                    </select>
                </div>
            </div>
            <hr/>
            <div class="layui-form-item" style="text-align: center;">
                <button class="layui-btn" lay-submit="" lay-filter="save" url="#(base)/train/addTrain">新增</button>
                <button type="button" class="layui-btn layui-btn-primary" function="close">关闭</button>
            </div>
        </form>
    </div>
</div>
<script>
    //加载模块
    layui.use(['jquery', 'formSelects'], function(){
        formSelects.render('classids');
        formSelects.render('subjectids');
    });
</script>
#end